package com.sskj.wallet.presenter;

import com.lzy.okgo.model.Response;
import com.sskj.common.base.HttpData;
import com.sskj.lib.http.JsonCallBack;
import com.sskj.wallet.bean.WalletDetailBean;
import com.sskj.wallet.ui.activity.TransferActivity;


/**
 * @author Hey
 * Create at  2019/06/27
 */
public class TransferPresenter extends BasePresenter<TransferActivity> {

    public void getWalletDetail(int walletType) {
        httpService.getWalletDetail(walletType)
                .tag(this)
                .execute(new JsonCallBack<HttpData<WalletDetailBean>>(this) {
                    @Override
                    public void onSuccess(Response<HttpData<WalletDetailBean>> response) {
                        mView.getWalletDetailOK(response.body().getData());
                    }
                });
    }

    public void toTransfer(String coinType, String amount, String transferTo, String transferFrom) {
        httpService.toTransfer(coinType, amount, transferTo, transferFrom)
                .tag(this)
                .execute(new JsonCallBack<HttpData>(this) {
                    @Override
                    public void onSuccess(Response<HttpData> response) {
                        mView.toTransferOK();
                    }
                });

    }
}
